package com.code.base.info.service;

import java.util.List;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.code.base.info.persistence.InfoCorpMapper;
import com.code.base.info.pojo.InfoCorp;
import com.code.util.PrimaryKeyUtil;


@Service
public class InfoCorpService {


	@Resource
	private InfoCorpMapper infoCorpMapper;

	public Long getInsertId() {
		return PrimaryKeyUtil.generatePrimaryKey();
	}

	public InfoCorp getDataById(Long id) {
		return infoCorpMapper.getDataById(id);
	}

	public List<InfoCorp> getAllData() {
		return infoCorpMapper.getAllData();
	}

	public int getDataCountByCondition(InfoCorp entity) {
		return infoCorpMapper.getDataCountByCondition(entity);
	}

	public List<InfoCorp> getDataByCondition(InfoCorp entity) {
		return infoCorpMapper.getDataByCondition(entity);
	}

	public int getDataCountByLikeCondition(InfoCorp entity) {
		return infoCorpMapper.getDataCountByLikeCondition(entity);
	}

	public List<InfoCorp> getDataByLikeCondition(InfoCorp entity) {
		return infoCorpMapper.getDataByLikeCondition(entity);
	}

	public List<InfoCorp> getDataByIds(Long[] ids) {
		return infoCorpMapper.getDataByIds(ids);
	}

	public void insertData(InfoCorp entity) {
		insertData(entity, true);
	}

	public void insertData(InfoCorp entity, boolean setIdValue) {
		if (setIdValue) {
			entity.setId(getInsertId());
		}
		infoCorpMapper.insertData(entity);
	}

	public void updateData(InfoCorp entity) {
		infoCorpMapper.updateData(entity);
	}

	public void updateDataByParam(Map<String, Object> map) {
		if (map.size() == 0)
			return;

		infoCorpMapper.updateDataByParam(map);
	}

	public void deleteDataByObject(InfoCorp entity) {
		infoCorpMapper.deleteDataByObject(entity);
	}

	public void deleteDataById(Long id) {
		infoCorpMapper.deleteDataById(id);
	}

	public void deleteDataByIds(Long[] ids) {
		infoCorpMapper.deleteDataByIds(ids);
	}

}
